package com.baor.controller;

import com.baor.domain.ProxyLevelVo;
import com.baor.domain.conf.ProxyConf;
import com.baor.service.ProxyConfService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/proxyConf")
public class ProxyConfController {

    @Autowired
    private ProxyConfService proxyConfService;

    @RequestMapping("isEnable")
    public AjaxResult<?> isEnable(@RequestBody ProxyConf vo) {
        return proxyConfService.isEnable(vo);
    }

//    @RequestMapping("insert")
//    public AjaxResult<?> insert(@RequestBody ProxyConf vo) {
//        return proxyConfService.insert(Integer.parseInt(vo.getSiteId()));
//    }

    @RequestMapping("levelList")
    public AjaxResult<?> levelList(@RequestBody Map<String, Object> param) {
        return proxyConfService.levelList(param);
    }

    @RequestMapping("delete")
    public AjaxResult<?> delete(@RequestBody ProxyLevelVo vo) {
        return proxyConfService.delete(vo);
    }

    @RequestMapping("insert")
    public AjaxResult<?> insert(@RequestBody ProxyLevelVo vo) {
        return proxyConfService.insert(vo);
    }

    @RequestMapping("update")
    public AjaxResult<?> update(@RequestBody ProxyLevelVo vo) {
        return proxyConfService.update(vo);
    }




}
